//
//  QMUILabel+Extension.m
//  TankCat
//
//  Created by apple on 2021/6/2.
//  Copyright © 2021 tigoSoft. All rights reserved.
//

#import "QMUILabel+Extension.h"

@implementation QMUILabel (Extension)
+ (instancetype)labelWithTitle:(NSString *)title color:(UIColor *)color fontSize:(CGFloat)fontSize {
    return [self labelWithTitle:title color:color fontSize:fontSize alignment:NSTextAlignmentCenter];
}

+ (instancetype)labelWithTitle:(NSString *)title color:(UIColor *)color fontSize:(CGFloat)fontSize alignment:(NSTextAlignment)alignment {
    
    QMUILabel *lab = [[QMUILabel alloc] init];
    lab.canPerformCopyAction = YES;
    lab.text = title;
    lab.textColor = color;
    lab.font = [UIFont systemFontOfSize:fontSize];
    lab.numberOfLines = 0;
    lab.textAlignment = alignment;
    [lab sizeToFit];
    
    return lab;
}

+ (instancetype)labelWithTitle:(NSString *)title color:(UIColor *)color font:(UIFont *)font {
    return [self labelWithTitle:title color:color font:font alignment:NSTextAlignmentCenter];
}

+ (instancetype)labelWithTitle:(NSString *)title color:(UIColor *)color font:(UIFont *)font alignment:(NSTextAlignment)alignment {
    
    QMUILabel *lab = [[QMUILabel alloc] init];
    lab.text = title;
    lab.canPerformCopyAction = YES;
    lab.textColor = color;
    lab.font = font;
    lab.numberOfLines = 0;
    lab.textAlignment = alignment;
    [lab sizeToFit];
    return lab;
}

@end
